
import axios from 'axios';

/**
 * 成本管理
 */
export class CostService {
    // 分页查询列表
    static findCosts (queryParams) {
        return axios({
            url: '/restaurant/material/Cost/findCosts',
            method: 'POST',
            data: queryParams
        });
    }

    //根据ID查询指定的成本管理
    static findCost (costId) {
        const query = {
            costId
        }
        return axios({
            url: '/restaurant/material/Cost/findCost',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的成本管理(包含外键名称)
    static findCostForView (costId) {
        const query = {
            costId
        }
        return axios({
            url: '/restaurant/material/Cost/findCostForView',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的成本管理(包含外键名称)
    static findCostForEdit (costId) {
        const query = {
            costId
        }
        return axios({
            url: '/restaurant/material/Cost/findCostForEdit',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的成本管理(只提取ID 和 Name)
    static findCostsWithIdNameById (costId) {
        const query = {
            costId
        }
        return axios({
            url: '/restaurant/material/Cost/findCostsWithIdNameById',
            method: 'POST',
            params: query,
        });
    }

    //根据名称查询成本管理集合(只提取ID 和 Name)
    static findCostsWithIdNameByName (costName) {
        const query = {
            costName
        }
        return axios({
            url: '/restaurant/material/Cost/findCostsWithIdNameByName',
            method: 'POST',
            params: query,
        });
    }

    //新增保存成本管理
    static saveCost (cost) {
        const query = {}
        return axios({
            url: '/restaurant/material/Cost/saveCost',
            method: 'POST',
            params: query,
            data: cost
        });
    }

    //修改保存成本管理
    static updateCost (cost) {
        const query = {}
        return axios({
            url: '/restaurant/material/Cost/updateCost',
            method: 'POST',
            params: query,
            data: cost
        });
    }

    //根据ID查询指定的成本管理(只提取ID 和 Name)
    static deleteCost (costId) {
        const query = {
            costId
        }
        return axios({
            url: '/restaurant/material/Cost/deleteCost',
            method: 'POST',
            params: query,
        });
    }
}
